mi: fix missing braces around initializer warnings#1011
mi: fix missing braces around initializer warnings#1011igaw merged 1 commit intolinux-nvme:masterfrom
Conversation
b86c618 to
67fcef4
Compare
|
Which version of CentOS and gcc is this? Is this really CentOS or CentOS stream? I thought CentOS is EOL. |
|
Can you include the warnings in your commits or PR? this will help to verify the fix. |
|
Based on the changes proposed here, it would be good to intentionally decide whether we want to support compilers that do not allow struct initializers - or is this just a braces thing? |
|
This is also my thinking. If these are EOL distros I don't think we should support those old compilers. |
|
Yes the build warning errors caused on CentOS EOL. Yes now I am checking this on CentOS stream so will update later. |
|
Actually the warning errors below and attached build log on CentOS 7 EOL not happend on the CentOS 9 stream but is it really not supported the CentOS 7 EOL by the muon build since currently the CentOS 7 build described by the wiki page: https://github.com/linux-nvme/nvme-cli/wiki/Building-nvme‐cli? [42/164] compiling c nvme.p/plugins/ocp/ocp-print-binary.c.o
In file included from ../subprojects/libnvme/src/libnvme-mi.h:17:0,
from ../subprojects/libnvme/examples/mi-mctp-ae.c:20:
../subprojects/libnvme/src/nvme/mi.h: In function 'nvme_mi_aem_ack':
../subprojects/libnvme/src/nvme/mi.h:1329:9: warning: missing braces around initializer [-Wmissing-braces]
struct nvme_mi_aem_enable_list list = {0};
^
../subprojects/libnvme/src/nvme/mi.h:1329:9: warning: (near initialization for 'list.hdr') [-Wmissing-braces] |
|
By the way the following error also still caused on the CentOS stream 9 actually so I will do investigate more later. [142/166] linking subprojects/libnvme/test/test-mi
samu: job failed with status 1: gcc -o subprojects/libnvme/examples/mi-mctp-csi-test subprojects/libnvme/examples/mi-mctp-csi-test.p/mi-mctp-csi-test.c.o -Wl,--as-needed -Wl,--no-undefined -static -Wl,--start-group subprojects/libnvme/src/libnvme-mi.a subprojects/libnvme/ccan/libccan.a -Wl,--end-group
subprojects/libnvme/examples/mi-mctp-csi-test.p/mi-mctp-csi-test.c.o: In function `do_csi_test':
/home/tokunori/nvme-cli/.build-ci/../subprojects/libnvme/examples/mi-mctp-csi-test.c:151: undefined reference to `pthread_create'
/home/tokunori/nvme-cli/.build-ci/../subprojects/libnvme/examples/mi-mctp-csi-test.c:162: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
../plugins/wdc/wdc-nvme.c: In function 'wdc_print_unsupported_reqs_log_json':
../plugins/wdc/wdc-nvme.c:5381:71: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
sprintf((char *)unsup_req_list_str, "Unsupported Requirement List %d", j);
^
../plugins/wdc/wdc-nvme.c:5381:3: note: 'sprintf' output between 31 and 41 bytes into a destination of size 40
sprintf((char *)unsup_req_list_str, "Unsupported Requirement List %d", j);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samu: subcommand failed |
ok, the new CSI test likely needs an explicit |
|
For the CentOS 7, 8 case, I don't think we need to bother anymore. If there are still users out there using an EOL distro, they are own their own. That means we should just update our wiki. CentOS stream: we could setup a CI build for this as well to catch these errors earlier.
|
|
Okay I will do update the wiki as the CentOS 7 and 8 EOL dropped as unsupported later. By the way about the pthread issue I just thought as how about is to disable the test build using pthread on muon to avoid the muon build error? Thank you. (Add) |
nice! so does that mean we're not supporting that old meson version in? or that we'll want to add the explicit pthread dependency? |
|
I think meson would reject to build if the minimal version requirment is not met. Thus I think we support the old version of meson which doesn't add pthread. Let's add it explicitly and add a comment that when we update the minimal meson version requirement to check if this is still needed. |
0f08b98 to
16544a9
Compare
|
Deleted the original commit and added the the pthread dependency commit instead. Thank you. |
Older version of meson do not add automatically the pthread dependency. Thus add it explicitly to thebuild. Signed-off-by: Tokunori Ikegami <[email protected]>
|
rebased to resolve merge conflict. |
The fix required for the muon build on CentOS.